package com.uchengwang.ui.cm_ui.me.bean;

import android.text.TextUtils;

import com.uchengwang.ui.cm_ui.ucity.cityBean.ImageAndTextBean;
import com.uchengwang.ui.cm_ui.umsg.bean.ClubAccessBean;
import com.uchengwang.ui.utils.JsonUtils;

import java.util.List;

/**
 * Created by U城网 on 2017/6/16.
 * 留言
 */

public class ClubNoteBean {

    private long createTime;
    private long id;
    private String message;
    private long recruitId;//社团分享ID
    private long uid;

    private String userAvatar;
    private String nickName;
    private String cover;
    private ClubAccessBean recruit;

    public ClubAccessBean getRecruit() {
        return recruit;
    }

    public void setRecruit(ClubAccessBean recruit) {
        this.recruit = recruit;
    }

    public String getUserAvatar() {
        return userAvatar;
    }

    public void setUserAvatar(String userAvatar) {
        this.userAvatar = userAvatar;
    }

    public String getNickName() {
        return nickName;
    }

    public void setNickName(String nickName) {
        this.nickName = nickName;
    }

    public String getCover() {
        if (recruit != null){
            String desc = recruit.getRecruitDescription();
            if (!TextUtils.isEmpty(desc)){
                List<ImageAndTextBean> list = JsonUtils.getManager().parseList(desc, ImageAndTextBean.class);
                if (list != null && list.size() >0){
                    for (ImageAndTextBean bean:list){//0图片  1文字
                        if (bean.getType() ==0){
                            cover = bean.getContent();
                            break;
                        }
                    }
                }

            }
        }
        return cover;
    }

    public void setCover(String cover) {
        this.cover = cover;
    }

    public long getCreateTime() {
        return createTime;
    }

    public void setCreateTime(long createTime) {
        this.createTime = createTime;
    }

    public long getId() {
        return id;
    }

    public void setId(long id) {
        this.id = id;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    public long getRecruitId() {
        return recruitId;
    }

    public void setRecruitId(long recruitId) {
        this.recruitId = recruitId;
    }

    public long getUid() {
        return uid;
    }

    public void setUid(long uid) {
        this.uid = uid;
    }
}
